package org.itboys.mobile.service.mongo.web;

import org.itboys.mobile.common.SundayCommonConstants;
import org.itboys.mobile.entity.mongo.SundayCollection;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author：贾琦磊
 * @Date：2018/7/11
 * @Description：收藏
 */
@Service
public class SundayCollectionService extends BaseMongoService<SundayCollection> {
    @Resource(name = "mobileDs")
    private MongoDataSource dataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return dataSource;
    }
    @Override
    protected Class<SundayCollection> getEntityClass() {
        return SundayCollection.class;
    }

    public List<SundayCollection> select(List<Long> ids,Integer type){
        Map param=new HashMap<>();
        param.put("type",type);
        param.put("otherId in",ids);
        param.put("isDeleted",SundayCommonConstants.NO);
        return  super.list(param);
    }
}
